home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / do1003.zip / USBBSBRD.SCR < prev   
Text File  |  1991-12-11  |  4KB  |  108 lines

  1. *┌────────────────────────────────────────────────────────────┐
  2. *│ SCRIPT: USBBSBRD.SCR                                       │
  3. *│         Searches the USBBS list and selects boards running │
  4. *│         specific software.                                 │
  5. *│        (Demonstrates techniques for working with files and │
  6. *│         the use of functions.)                             │
  7. *└────────────────────────────────────────────────────────────┘
  8. /STOP End
  9. .clr
  10.  
  11.                        »ye«USBBS National BBS list Processor»#«
  12.  
  13.  
  14. /BOX 1 1 80 3 11 7 ""
  15. .wi 1 4 80 25
  16. * Check to see if the list is in the current directory.
  17. /EXIST USBBS.LST
  18. :EXISTERROR
  19. * Board list does not exist.  Tell the user and exit.
  20. .bell
  21.  
  22.     USBBS.LST not found in the current directory!
  23.  
  24. .pg
  25. /GOTO End
  26. :EXISTOK
  27. * USBBS.LST was found, so process it:
  28. »bo«TYPE CODES                                                                  »#«
  29.    A = Auntie                      O = Opus/Maximus
  30.    B = PCBoard                     P = GT PowerComm
  31.    C = Phoenix/Collie/Collosus     Q = QuickBBS/RemoteAccess
  32.    D = dBBS                        S = Searchlight
  33.    F = Spitfire                    T = TBBS or TCOMM
  34.    G = GAP                         U = UltraBBS
  35.    H = PC-Host                     V = WWIV
  36.    I = Magpie                      W = Wildcat
  37.    J = SuperBBS                    X = BBS-PC,RyBBS,ROS,Fido,Citadel,Osiris,
  38.    L = Telegard                        or custom, unverified or unknown type
  39.    M = OraComm/Major/Galacticomm   Y = T.A.G.
  40.    N = Genesis                     Z = TPBoard
  41.  
  42. /GETC "   Board:" ABCDFGHIJLMNOPQSTUVWXYZ~027
  43. /IF %char NE ~027 End
  44. * Since CHAR is used by multiple functions, be sure to move it to a
  45. * variable to assure that it will be held.
  46. /SET BD %CHAR
  47. /MATH BoardsProcessed 0
  48. /MATH BoardsSelected 0
  49. .clr
  50. »ye« Processing Board: »c 14 1«%BD»#« [Press »bo«<esc>»#« to abort]
  51. /DRAW H 2 2 78
  52. * Set the working window
  53. .wi 1 7 80 25
  54. * Open the files for reading and writing.  Note, if USBBS.OUT exists
  55. * it will be backed up.
  56. /OPEN 1 USBBS.LST R
  57. * rename the file if it exists
  58. /ERASE USBBS.BAK N
  59. /RENAME USBBS.OUT USBBS.BAK N
  60. /OPEN 2 USBBS.OUT W
  61. :ReadHeading
  62. /READ 1 | Line
  63. * The inkey function allows us to stop while the script is processing
  64. /INKEY ~027 EOF
  65. * Use the reset option to make sure the PagePrompt is not displayed
  66. .reset
  67. %FileBuffer
  68. * Ignore all lines before the heading
  69. /IF %FileBuffer LK "----------*" ReadHeading
  70. :ReadRecord
  71. /READ 1 | Line
  72. /INC BoardsProcessed
  73. /INKEY ~027 EOF
  74. /IF @cpy(%FileBuffer,46,1) EQ %BD CheckRecord
  75. /INC BoardsSelected
  76. .reset
  77. * Display the matched line in reversed video.  The L79 assures that the
  78. * reverse video goes across the entire screen rather than ending at a
  79. * short line.
  80. »bo«%FileBuffer(L79)»#«
  81. /SET Phone @cpy(%FileBuffer,1,28)
  82. /SET Name @trim(@cpy(%FileBuffer,59,21)," 1234567890/?",R)
  83. /SET SoftWare @cpy(%FileBuffer,46,2)
  84. /SET Speed @cpy(%FileBuffer,51,3)
  85. /WRITE 2 "%Phone %Name(L21) %SoftWare(L2) %Speed"
  86. /GOTO ReadRecord
  87. :CheckRecord
  88. * Stop when the bottom line is found
  89. /IF %FileBuffer NL "----------*" EOF
  90. .reset
  91. %FileBuffer
  92. /GOTO ReadRecord
  93. :EOF
  94. :End
  95. /CLOSE 1
  96. /CLOSE 2
  97. * reset the window and assure that the prompt appears at the bottom
  98. * of the page if the script is run from interactive mode
  99. .wi full go 1 25
  100. /MATH Percent (%BoardsSelected/%BoardsProcessed)*100
  101. /DRAW H {Y} 2 78
  102.  
  103. »ma« Boards Processed»gy« :»wh« %BoardsProcessed
  104. »ma« Boards Selected»gy«  :»wh« %BoardsSelected»#« [%Percent(##.#)%]
  105.  
  106. * End the script and clear all the variables used
  107. /ENDEXEC CLEAR
  108.